package chouxiang;
//继承抽象版
public class Test {
    public static void main(String[] args) {
        Animal a = new Cat();
        a.setName("抽象猫1");
        a.setAge(2);
        a.eat(a.getName());
        ((Cat)a).catchMouse(a.getName());

        Animal b = new Animal() {
            @Override
            public void eat(String name) {
                System.out.println(name +"干点啥");
            }
        };
        b.eat("aaa");

    }
}
